All Questions
Tagged with nested-loopsphp
263 questions
0votes
1answer
34views
String folder structure with all matching folders listed
I've been trying to do this for a few days and really I'm struggling. How do I generate all possible scanned folders from the string below and replace all possible folders in %%%ANY_DIR%%%? $...
1vote
1answer
41views
Nested for loops too slow - PHP Codewars Kata Integers: Recreation One
I was working on the codewars kata Integers: Recreation One: 1, 246, 2, 123, 3, 82, 6, 41 are the divisors of number 246. Squaring these divisors we get: 1, 60516, 4, 15129, 9, 6724, 36, 1681. The ...
-1votes
1answer
63views
Wordpress get_terms & wp_query shows wrong results
I do have subpage where I want to present & filter job postings for my clients company. The filtering is based on two taxonomies: job-category (examples: logistics, hr, marketing etc); filtering ...
0votes
1answer
64views
How to loop foreach inside loop div [closed]
i want to create and tabel every showing 3 data from db and continue the next db. exp swiper 1 : (1,2,3) , Swiper 2 : (4,5,6) etc. is it possible to loop a div and have a foreach in it? or any ...
1vote
1answer
45views
Change key indexing format for nth level of nested array in php
I have nth level of nested array with string naming key , I want to convert that in indexing key only for array of item key. i tried it to convert but that conversation only possible for limited level ...
2votes
1answer
140views
Laravel getting last items from 2nd Level of nested array
I am working with laravel framework and I have a nested array in which to display a subset of results. For example, on the array below I display multi task per year. Array ( [0] => ...
0votes
0answers
84views
Can I use a template-part inside a WP Query?
I am building my custom WP theme, that consists of multiple custom post types. One of the CPT is artists and the others are music labels: CPT#1: Artists CPT#2: Music Label called 'Triple Cash' CPT#3: ...
0votes
1answer
112views
PHP Creating Nested Array Dynamically
I am having trouble on how can I get the result of the nested array, it shows only one data per Branch, it should be show all Division per Branch. $selectedBranches = ['1', '5']; $selectedDivisions = [...
-2votes
1answer
632views
PHP ForEach Loop inside while Returning Duplicate Rows
I am trying to create a Nested Checkbox List in PHP. For this I have written Below Code with Multiple Nested foreach loop inside while <?php $sql_concern="SELECT * FROM sister_concern ...
0votes
1answer
53views
I want to remove filter by color attribute and its value
My ecommerce have many Attributes for filter product . Every Attributes showing with foreach loop . Now I Want to remove filter by color and it's value. How I can Do it. This Image red circle I want ...
-1votes
1answer
56views
Pulling Json path from MySQL database using php
I am trying to pull JSON data path stored inside MySQL database but I am getting an error message when executing the PHP command. $json = json_decode($response); $json_feed = "data->value"...
0votes
1answer
66views
JSON nested array parse via PHP
I need to loop through and print all nested data within the "players" array and sort by "wonAmount." I can get my PHP to print out a single value, which I target, but I can't get ...
0votes
1answer
200views
How to create multidimensional array in nested loop while?
I have nested loop while and I'd like to create multidimensional array with some datas from these loops Output should be look like: 'productId'=>1 'productImg'=>some_url 'productContent'=> ...
0votes
2answers
233views
Trying to Remove Nesting from Json Array in PHP
As you can see i have a json array with multiple elements, and I have been trying to remove the nesting ("DEMARCHE") element and I want the array to be flattened. but It is only giving a ...
2votes
1answer
442views
php calling a function in a class from within a nested foreach loop
I am trying to call functions in a class "HelperImageGallery" from within a nested foreach loop but I get "Trying to access array offset on value of type bool" errors. The target ...